Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move cmake_minimum_required above project line and upgrade minmum cma… #3545

Merged
merged 1 commit into from
Sep 13, 2023

Conversation

adamkewley
Copy link
Contributor

@adamkewley adamkewley commented Sep 13, 2023

Minor drive-by change.

When building dependencies with a modern cmake/VisualStudio etc. you'll see these two warnings.

The first is because cmake_minimum_required() must be called before project()

$ cmake -S dependencies -B deps-build -DCMAKE_INSTALL_PREFIX=${PWD}/deps-install -G"Visual Studio 17 2022" -A x64 -DOPENSIM_WITH_CASADI=OFF -DOPENSIM_WITH_TROPTER=OFF
CMake Warning (dev) at CMakeLists.txt:5 (project):
  cmake_minimum_required() should be called prior to this top-level project()
  call.  Please see the cmake-commands(7) manual for usage documentation of
  both commands.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Deprecation Warning at CMakeLists.txt:7 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- Configuring done (0.1s)
-- Generating done (0.1s)
-- Build files have been written to: C:/Users/adamk/Desktop/opensim-core/deps-build

The second is because modern cmake is deprecating cmake <3.4:

$ cmake -S dependencies -B deps-build -DCMAKE_INSTALL_PREFIX=${PWD}/deps-install -G"Visual Studio 17 2022" -A x64 -DOPENSIM_WITH_CASADI=OFF -DOPENSIM_WITH_TROPTER=OFF
CMake Deprecation Warning at CMakeLists.txt:6 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- Configuring done (0.1s)
-- Generating done (0.1s)
-- Build files have been written to: C:/Users/adamk/Desktop/opensim-core/deps-build

This changeset stops those warnings from popping up


This change is Reviewable

@nickbianco nickbianco merged commit d725360 into main Sep 13, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants